package com.smart.fourteen.hibernate.api;

import com.smart.fourteen.hibernate.model.Topic;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class TopicDao {
    @Autowired
    private SessionFactory sessionFactory;

    public void addTopic(Topic topic){
        sessionFactory.getCurrentSession().save(topic);
    }

    public void updateTopic(Topic topic){
        sessionFactory.getCurrentSession().update(topic);
    }
}
